home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesJ-M.lzh / LicenceToKill.lha / LicenceToKillHD / Install next >
Text File  |  2000-06-12  |  4KB  |  225 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of the readme file
  4.  
  5. (procedure P_MakeImages
  6.  
  7.   ;the following lines must be copied and adjusted for multiple disk images
  8.  
  9.   (set #vers
  10.     (askchoice
  11.       (prompt "\nWhich version of the game do you have?\n")
  12.       (default 2)
  13.       (choices "Heroes compilation" "James Bond Collection" "Other")
  14.       (help @askchoice-help)
  15.     )
  16.   )
  17.   (set #vers 0)
  18.  
  19.   (select #vers
  20.     (set #CI_disklen 710144)
  21.     (set #CI_disklen 706048)
  22.     (set #CI_disklen 901120)
  23.   )
  24.  
  25.   (set #CI_disknum 1)
  26.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  27.   (set #CI_skiptrk -1)
  28.   (P_CreateImage)
  29. )
  30.  
  31. ;****************************
  32. ;----------------------------
  33. ; checks if given program is installed, if not abort install
  34. ; #program - to check
  35.  
  36. (procedure P_ChkRun
  37.   (if
  38.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  39.     ("")
  40.     (abort 
  41.       (cat
  42.     "You must install \"" #program "\" first!\n"
  43.     "It must be accessible via the path.\n"
  44.     "You can find it in the WHDLoad package."
  45.       )
  46.     )
  47.   )
  48. )
  49.  
  50. ;----------------------------
  51. ; Create Image using DIC
  52. ; #dest        - path to save image in
  53. ; #CI_disknum  - number of the disk image to create
  54. ; #CI_diskname - label of the disk
  55. ; #CI_disklen  - length of disk image to create
  56. ; #CI_skiptrk  - track to skip, -1 means no skip
  57. ; #CI_drive    - drive to create image from
  58.  
  59. (procedure P_CreateImage
  60.   (message
  61.     (cat
  62.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive " !\n\n"
  63.     "(make sure it's the right disk because it will not be checked)"
  64.     )
  65.   )
  66.   (if
  67.     (>= #CI_skiptrk 0)
  68.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  69.     (set #option "")
  70.   )
  71.   (if
  72.     (= 0
  73.       (run 
  74.         (cat
  75.           "cd \"" #dest "\"\n"
  76.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  77.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  78.         )
  79.       )
  80.     )
  81.     (run ("FileNote %s Quiet" #CI_diskname))
  82.     (abort "\"DIC\" has failed to create a diskimage")
  83.   )
  84. )
  85.  
  86. ;****************************
  87.  
  88. (if
  89.   (exists #readme-file)
  90.   (if
  91.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  92.     ("")
  93.     (run ("SYS:Utilities/More %s" #readme-file))
  94.   )
  95. )
  96.  
  97. (set #program "WHDLoad")
  98. (P_ChkRun)
  99.  
  100. (set #program "DIC")
  101. (P_ChkRun)
  102.  
  103. ; in expert mode ask for source drive
  104. (if
  105.   (= @user-level 2)
  106.   (
  107.     (set #CI_drive
  108.       (askchoice
  109.     (prompt "Select source drive for diskimages")
  110.     (default 0)
  111.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  112.     (help @askchoice-help)
  113.       )
  114.     )
  115.     (select #CI_drive
  116.       (set #CI_drive "DF0:")
  117.       (set #CI_drive "DF1:")
  118.       (set #CI_drive "RAD:")
  119.       (set #CI_drive
  120.         (askstring
  121.           (prompt "Select source drive for diskimages")
  122.           (default "DF0:")
  123.           (help @askstring-help)
  124.         )
  125.       )
  126.     )
  127.   )
  128.   (set #CI_drive "DF0:")
  129. )
  130.  
  131. (set @default-dest
  132.   (askdir
  133.     (prompt 
  134.       (cat
  135.     "Where should \"" @app-name "\" installed ?\n"
  136.     "A drawer \"" @app-name "\" will automatically created."
  137.       )
  138.     )
  139.     (help @askdir-help)
  140.     (default @default-dest)
  141.     (disk)
  142.   )
  143. )
  144. (set #dest (tackon @default-dest @app-name))
  145. (if
  146.   (exists #dest)
  147.   (
  148.     (set #choice
  149.       (askbool
  150.         (prompt
  151.           (cat
  152.             "\nDirectory \"" #dest "\" already exists.\n"
  153.             "Should it be deleted?"
  154.           )
  155.         )
  156.         (default 1)
  157.         (choices "Delete" "Skip")
  158.         (help @askbool-help)
  159.       )
  160.     )
  161.     (if
  162.       (= #choice 1)
  163.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  164.     )
  165.   )
  166. )
  167. (makedir #dest
  168.   (help @makedir-help)
  169.   (infos)
  170. )
  171.  
  172. ;----------------------------
  173.  
  174. (copyfiles
  175.   (help @copyfiles-help)
  176.   (source ("%s.Slave" @app-name))
  177.   (dest #dest)
  178. )
  179. (if
  180.   (exists ("%s.newicon" @app-name))
  181.   (set #icon
  182.     (askchoice
  183.       (prompt "\nWhich icon do you like to install ?\n")
  184.       (default 0)
  185.       (choices "Normal" "NewIcon" "RomIcon")
  186.       (help @askchoice-help)
  187.     )
  188.   )
  189.   (set #icon 0)
  190. )
  191. (select #icon
  192.   (set #icon ("%s.inf" @app-name))
  193.   (set #icon ("%s.newicon" @app-name))
  194.   (set #icon ("%s.romicon" @app-name))
  195. )
  196. (copyfiles
  197.   (help @copyfiles-help)
  198.   (source #icon)
  199.   (newname ("%s.info" @app-name))
  200.   (dest #dest)
  201. )
  202. (if
  203.   (exists #readme-file)
  204.   (copyfiles
  205.     (help @copyfiles-help)
  206.     (source #readme-file)
  207.     (dest #dest)
  208.   )
  209. )
  210. (if
  211.   (exists ("%s.info" #readme-file))
  212.   (copyfiles
  213.     (help @copyfiles-help)
  214.     (source ("%s.info" #readme-file))
  215.     (dest #dest)
  216.   )
  217. )
  218.  
  219. (P_MakeImages)
  220.  
  221. ;----------------------------
  222.  
  223. (exit)
  224.  
  225.